﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IndignaFramework.Models;

namespace IndignaFramework.Controllers.Code
{
    public static class MovimientoHelper
    {
        
        public static int MovimientoId { get 
            {
            
                try
                {
                    Model1Container db = new Model1Container();
                    var dns = HttpContext.Current.Request.Url.DnsSafeHost;
                    var mov = db.Dominios.Where(x => x.Url == dns).Select(x => x.Movimiento_id).First();
                    if (mov < 1)
                        return 1;
                    return mov;
                }
                catch (Exception)
                {
                    return 1;
                }
            }
        }
        
        
     }
}